package com.task.web.controller.core;

import javax.annotation.Resource;

import com.task.core.domain.DataOperationInfo;
import com.task.core.dto.request.MissionDataDetailRequestDTO;
import com.task.core.vo.resp.DataContentDetailRespVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import com.task.common.core.controller.BaseController;
import com.task.common.core.domain.AjaxResult;
import com.task.common.core.page.TableDataInfo;
import com.task.core.dto.request.DataSendDetailRequestDTO;
import com.task.core.dto.request.MissionSendDetailRequestDTO;
import com.task.core.service.SendHistoryService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * @author 迪迦.
 * @date 2024/12/27 14:17
 */
@RestController
@Api("数据发送历史")
@RequestMapping("/sendHistory")
public class SendHistoryController extends BaseController {

  @Resource
  private SendHistoryService sendHistoryService;

  @ApiModelProperty("获取数据发送分页详情")
  @PreAuthorize("@ss.hasPermi('dataRecord:list')")
  @GetMapping("/getDataSendDetailHistory")
  public TableDataInfo getDataSendDetailHistory(DataSendDetailRequestDTO request) {
    return getDataTable(sendHistoryService.getDataSendDetailHistory(request));
  }

  //@ApiModelProperty("根据Id获取数据发送详情")
  //@PreAuthorize("@ss.hasPermi('dataRecord:list')")
  //@GetMapping("/getDataSendDetailById")
  //public AjaxResult getDataSendDetailById(DataSendDetailRequestDTO request) {
  //  return success(sendHistoryService.getDataSendDetailById(request));
  //}

  @ApiModelProperty("获取任务发送分页详情")
  @PreAuthorize("@ss.hasPermi('missionRecord:list')")
  @GetMapping("/getMissionSendDetailHistory")
  public TableDataInfo getMissionSendDetailHistory(MissionSendDetailRequestDTO request) {
    return getDataTable(sendHistoryService.getMissionSendDetailHistory(request));
  }

  @ApiModelProperty("获取任务发送数据详情")
  @GetMapping("/getMissionDataDetail")
  public AjaxResult getMissionDataDetail(MissionDataDetailRequestDTO request) {
    List<DataContentDetailRespVo> respVos = sendHistoryService.getMissionDataDetail(request);
    return success(respVos);
  }


}
